<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: CollisionDetector Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classfabgl_1_1_collision_detector.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classfabgl_1_1_collision_detector-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">CollisionDetector Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A class to detect sprites collisions.  
 <a href="classfabgl_1_1_collision_detector.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="collisiondetector_8h_source.html">collisiondetector.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aadae4076ddcd85581efac286bb8d799c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_aadae4076ddcd85581efac286bb8d799c.html#aadae4076ddcd85581efac286bb8d799c">CollisionDetector</a> (int maxObjectsCount, int <a class="el" href="fabutils_8h_ae0ffb42440f0305b6d22a1c6106b6e6f.html#ae0ffb42440f0305b6d22a1c6106b6e6f">width</a>, int <a class="el" href="fabutils_8h_a777dd66f9609a587ee98ad50de301662.html#a777dd66f9609a587ee98ad50de301662">height</a>)</td></tr>
<tr class="memdesc:aadae4076ddcd85581efac286bb8d799c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an instance of <a class="el" href="classfabgl_1_1_collision_detector.html" title="A class to detect sprites collisions. ">CollisionDetector</a>.  <a href="classfabgl_1_1_collision_detector_aadae4076ddcd85581efac286bb8d799c.html#aadae4076ddcd85581efac286bb8d799c">More...</a><br /></td></tr>
<tr class="separator:aadae4076ddcd85581efac286bb8d799c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48b03f63e22824a043e5df322ecebd3c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_a48b03f63e22824a043e5df322ecebd3c.html#a48b03f63e22824a043e5df322ecebd3c">addSprite</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite)</td></tr>
<tr class="memdesc:a48b03f63e22824a043e5df322ecebd3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the specified sprite to collision detector.  <a href="classfabgl_1_1_collision_detector_a48b03f63e22824a043e5df322ecebd3c.html#a48b03f63e22824a043e5df322ecebd3c">More...</a><br /></td></tr>
<tr class="separator:a48b03f63e22824a043e5df322ecebd3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af49934327173c9c132ad03a49cbe88dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_af49934327173c9c132ad03a49cbe88dd.html#af49934327173c9c132ad03a49cbe88dd">detectCollision</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite, bool removeCollidingSprites=true)</td></tr>
<tr class="memdesc:af49934327173c9c132ad03a49cbe88dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Detects first collision with the specified sprite.  <a href="classfabgl_1_1_collision_detector_af49934327173c9c132ad03a49cbe88dd.html#af49934327173c9c132ad03a49cbe88dd">More...</a><br /></td></tr>
<tr class="separator:af49934327173c9c132ad03a49cbe88dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a5ba3dccacba4da74daf832bca16dbc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_a9a5ba3dccacba4da74daf832bca16dbc.html#a9a5ba3dccacba4da74daf832bca16dbc">detectCollision</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite, CollisionDetectionCallback callbackFunc, void *callbackObj)</td></tr>
<tr class="memdesc:a9a5ba3dccacba4da74daf832bca16dbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Detects multiple collisions with the specified sprite.  <a href="classfabgl_1_1_collision_detector_a9a5ba3dccacba4da74daf832bca16dbc.html#a9a5ba3dccacba4da74daf832bca16dbc">More...</a><br /></td></tr>
<tr class="separator:a9a5ba3dccacba4da74daf832bca16dbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefc081299e5e20cd9b6d900de8559248"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_aefc081299e5e20cd9b6d900de8559248.html#aefc081299e5e20cd9b6d900de8559248">removeSprite</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite)</td></tr>
<tr class="memdesc:aefc081299e5e20cd9b6d900de8559248"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the specified sprite from collision detector.  <a href="classfabgl_1_1_collision_detector_aefc081299e5e20cd9b6d900de8559248.html#aefc081299e5e20cd9b6d900de8559248">More...</a><br /></td></tr>
<tr class="separator:aefc081299e5e20cd9b6d900de8559248"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5da37881b02299b991afee3cd96bf57"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_ad5da37881b02299b991afee3cd96bf57.html#ad5da37881b02299b991afee3cd96bf57">update</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite)</td></tr>
<tr class="memdesc:ad5da37881b02299b991afee3cd96bf57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates collision detector.  <a href="classfabgl_1_1_collision_detector_ad5da37881b02299b991afee3cd96bf57.html#ad5da37881b02299b991afee3cd96bf57">More...</a><br /></td></tr>
<tr class="separator:ad5da37881b02299b991afee3cd96bf57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae98903a2c36b115ac076b56fa3a64416"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_ae98903a2c36b115ac076b56fa3a64416.html#ae98903a2c36b115ac076b56fa3a64416">updateAndDetectCollision</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite, bool removeCollidingSprites=true)</td></tr>
<tr class="memdesc:ae98903a2c36b115ac076b56fa3a64416"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates collision detector and detect collision with the specified sprite.  <a href="classfabgl_1_1_collision_detector_ae98903a2c36b115ac076b56fa3a64416.html#ae98903a2c36b115ac076b56fa3a64416">More...</a><br /></td></tr>
<tr class="separator:ae98903a2c36b115ac076b56fa3a64416"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7b33b616a340e85f56563d6bf38b895"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_collision_detector_af7b33b616a340e85f56563d6bf38b895.html#af7b33b616a340e85f56563d6bf38b895">updateAndDetectCollision</a> (<a class="el" href="structfabgl_1_1_sprite.html">Sprite</a> *sprite, CollisionDetectionCallback callbackFunc, void *callbackObj)</td></tr>
<tr class="memdesc:af7b33b616a340e85f56563d6bf38b895"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates collision detector and detect multiple collisions with the specified sprite.  <a href="classfabgl_1_1_collision_detector_af7b33b616a340e85f56563d6bf38b895.html#af7b33b616a340e85f56563d6bf38b895">More...</a><br /></td></tr>
<tr class="separator:af7b33b616a340e85f56563d6bf38b895"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class to detect sprites collisions. </p>
<p><a class="el" href="classfabgl_1_1_collision_detector.html" title="A class to detect sprites collisions. ">CollisionDetector</a> uses a Quad-tree data structure to efficiently store sprites size and position and quick detect collisions.<br />
 <a class="el" href="classfabgl_1_1_collision_detector.html" title="A class to detect sprites collisions. ">CollisionDetector</a> is embedded in <a class="el" href="classfabgl_1_1_scene.html" title="Scene is an abstract class useful to encapsulate functionalities of a scene (sprites, collision detector and updates). ">Scene</a> class, so usually you don't need to instantiate it. </p>

<p class="definition">Definition at line <a class="el" href="collisiondetector_8h_source.html#l00129">129</a> of file <a class="el" href="collisiondetector_8h_source.html">collisiondetector.h</a>.</p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="collisiondetector_8h_source.html">collisiondetector.h</a></li>
<li><a class="el" href="collisiondetector_8cpp_source.html">collisiondetector.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>fabgl</b></li><li class="navelem"><a class="el" href="classfabgl_1_1_collision_detector.html">CollisionDetector</a></li>
    <li class="footer">Generated on Wed Dec 9 2020 16:48:31 for FabGL by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
